<template>
  <div>
    <h3>这个son组件---sync---{{ a }}---{{ b }}</h3>
    <button @click="doClick">同步修改</button>
  </div>
</template>

<script>

export default {
  props: {
    a: {
      type: Number,
      required: true
    },
    b: {
      type: Number,
      required: true
    }
  },
  methods: {
    doClick() {
      // this.num++, 不能直接修改父组件的值  this.sum = this.sum + 1
      this.$emit('update:a', this.a + 1)
      this.$emit('update:b', this.b + 10)
    }
  }
}

</script>

